net: hns3: fix a SSU buffer checking bug
authorYunsheng Lin <linyunsheng@huawei.com>
Tue, 18 Dec 2018 11:37:59 +0000 (19:37 +0800)
committerSalvatore Bonaccorso <carnil@debian.org>
Thu, 18 Jul 2019 22:23:17 +0000 (23:23 +0100)
commit80ec6f67d67a407c97627e9fede7fa7716ca10ea
tree5b86603d2603e799c36b8ff4fd2714c6425db67d
parent54382308d2a7dcae255c782b6d8ba2d22d0c77d2
net: hns3: fix a SSU buffer checking bug

When caculating the SSU buffer, it first allocate tx and
rx private buffer, then the remaining buffer is for rx
shared buffer. The remaining buffer size should be at
least bigger than or equal to the shared_std, which is the
minimum shared buffer size required by the driver, but
currently if the remaining buffer size is equal to the
shared_std, it returns failure, which causes SSU buffer
allocation failure problem.

This patch fixes this problem by rounding up shared_std before
checking the the remaining buffer size bigger than or equal to
the shared_std.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gbp-Pq: Topic bugfix/arm64/huawei-taishan
Gbp-Pq: Name 0022-net-hns3-fix-a-SSU-buffer-checking-bug.patch
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c